def main():
    y_or_n = input("是否退出程序（退出请输入yes，否则输入no）？")
    while (y_or_n != "yes"):
        print("请输入以下个人信息，中间用空格隔开")
        person_str = input("性别：体重（kg）：身高（cm）：年龄：")
        person = person_str.split(" ")
        try:
            gender = person[0]
            weight = float(person[1])
            height = float(person[2])
            age = int(person[3])

            if gender == "男":
                bmr = 13.7 * weight + 5.0 * height - 6.8 * age + 66
            elif gender == "女":
                bmr = 9.6 * weight + 3.8 * height - 4.7 * age + 655
            else:
                bmr = -1
            if bmr != -1:
                print("您的性别为{}，体重为{}kg，身高为{}cm，年龄为{}岁".format(gender, weight, height, age))
                print("您的基础代谢率为{}大卡".format(bmr))
            else:
                print("暂不支持该性别！")

        except ValueError:
            print("请输入正确的个人信息！")
        except IndexError:
            print("请输入完整的个人信息！")

        print()  # 输出空行
        y_or_n = input("是否退出程序（退出请输入yes）？")


if __name__ == "__main__":
    main()